package com.mhg.spring_aop;


import com.mhg.spring_aop.config.SpringConfig;
import com.mhg.spring_aop.service.MyService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class SpringAopApplication {

    public static void main(String[] args) {
        //获取spring容器
        ApplicationContext context =
                new AnnotationConfigApplicationContext(SpringConfig.class);
//        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");

        //从spring容器中获取对象 MyServiceImpl
        MyService myService = context.getBean(MyService.class);

        //调用注册
        myService.register("马华高",18,"广西南宁");

        //调用登录
        myService.login("马华高","123456");

        //调用搜索方法
        myService.search("马华高","男装");



    }

}
